home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / STRINGS.SWG / 0061_ASM Uppercase.pas < prev    next >
Pascal/Delphi Source File  |  1993-10-28  |  1KB  |  35 lines

  1. {===========================================================================
  2. Date: 10-02-93 (16:28)
  3. From: ERIK HJELME
  4. Subj: Upcase/Locase string or Char
  5. ---------------------------------------------------------------------------
  6.  
  7. BF> Does anybody know if DOS' multi-country support will
  8. BF> spit out a character uppercase/lowercase conversion table ?
  9.  
  10. Yes, function $6502 will let you see the conversion tables.
  11.  
  12. You can also use two conversion interrupts in your own programmes, the
  13. function isn't supported by older versions of DOS, but I don't know wich : }
  14.  
  15. function upcase(c:char):char; { will replace TP's built-in upcase }
  16. asm mov dl,c
  17.  mov ax,$6520
  18.  int $21
  19.  mov al,dl           { function result in AL                 }
  20.  end;
  21.  
  22. procedure upstr(var s);  { this will convert any TP string       }
  23. asm push ds
  24.  lds dx,s            { address of the s[0] character         }
  25.  
  26.  mov bx,dx
  27.  mov ch,0
  28.  mov cl,[bx]         { length of string in CX                }
  29.  
  30.  inc dx              { characters to convert in DS:DX        }
  31.  mov ax,$6521
  32.  int $21
  33.  pop ds
  34.  end;
  35.